package com.cs.pk.utils;

import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.ui.PlatformUI;

import com.cs.pk.Activator;

public class Util {
	
	public static int showMessage(String message,String title, int type) {
		MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getDisplay().getActiveShell(),type);
		mb.setMessage(message);
		mb.setText(title);
		return mb.open();
	}
	
	public static String getValues(String key) {
		return PlatformUI.getPreferenceStore().getString(key) != null ? PlatformUI.getPreferenceStore().getString(key) : Activator
				.getDefault().getDefaultPreference(key);
	}
	
	public static void setValue(String key, String value) {
		 PlatformUI.getPreferenceStore().setValue(key,value);
	}
	
	public static void setToDefaultValue(String key) {
		 PlatformUI.getPreferenceStore().setToDefault(key);
	}

}
